home *** CD-ROM | disk | FTP | other *** search
/ Mogel-CD / Mogel CD.iso / daten / amiga / install / t / towerofbabel.lha / Install_Tower_of_Babel < prev    next >
Encoding:
Text File  |  1997-12-20  |  6.3 KB  |  317 lines

  1. ;
  2. ;$VER: Tower of Babel HD Installer script v1.00 (c) 1997 John Girvin
  3. ;
  4.  
  5. ;---------------------------------------------------------------------------
  6. ; Make a disk image
  7.  
  8. (procedure S_MakeDisk #TDISKNUM #TDISKNAME
  9. (
  10.     (set #TDATFILE (tackon #TDATDIR (cat "Disk." #TDISKNUM)))
  11.  
  12.     (message
  13.         (cat
  14.             "\n\n\nPlease insert Tower of Babel "
  15.             #TDISKNAME
  16.             " in drive DF"
  17.             #TSRCDRIVE
  18.             ":\n\n"
  19.             "Click 'Proceed' when ready."
  20.         )
  21.     )
  22.  
  23.     (working
  24.         (cat "Creating image of "
  25.              #TDISKNAME
  26.              " in\'" #TDATDIR "'"
  27.         )
  28.     )
  29.  
  30.     (set #TRCODE (run (cat "TOBMakeDisk " #TSRCDRIVE " " #TDATFILE)))
  31.  
  32.     (if (>= #TRCODE 100)
  33.         (abort
  34.             (cat
  35.                 "Could not create image of "
  36.                 #TDISKNAME
  37.                 " !\n\nError: " #TRCODE
  38.             )
  39.         )
  40.     )
  41. ))
  42.  
  43. ;---------------------------------------------------------------------------
  44. ; Make game disk image/data
  45.  
  46. (procedure S_InstallGame
  47. (
  48.     ;
  49.     ; Make the game disk image
  50.     ;
  51.     (S_MakeDisk 1 "game disk")
  52.  
  53.     ;
  54.     ; Copy extractor slave to destination
  55.     ;
  56.     (copyfiles
  57.         (prompt "Copying data extractor slave")
  58.         (help @copyfiles-help)
  59.         (source "TOBMakeDat")
  60.         (dest #TDESTDIR)
  61.         (nogauge)
  62.         (noposition)
  63.         (optional fail force)
  64.     )
  65.  
  66.     ;
  67.     ; Call the data extractor
  68.     ;
  69.     (message    "\n\n*** WARNING ***\n\n"
  70.                 "The next stage of the installation process requires that"
  71.                 " multitasking be disabled temporarily while a data file"
  72.                 " is being read and decrypted. This may take up to one"
  73.                 " minute depending on the speed of your computer.\n\n"
  74.                 " Please ensure that all disk and network activity has"
  75.                 " finished before clicking 'Proceed'.\n\n"
  76.                 "Click 'Proceed' when ready."
  77.     )
  78.  
  79.     (working
  80.         (cat "Creating game data file in '" #TDATDIR "'\n\n"
  81.                 "*** Multitasking is disabled - DON`T PANIC! ***"
  82.         )
  83.     )
  84.  
  85.     (set #TOLDEXEDIR @execute-dir)
  86.     (set @execute-dir #TDESTDIR)
  87.     (run
  88.         (cat
  89.             (tackon #TDESTDIR
  90.                     "WHDLoad SLAVE=TOBMakeDat NOVBRMOVE NOCACHE NOAUTOVEC NOTRAPHANDLER"
  91.             )
  92.         )
  93.     )
  94.     (set @execute-dir #TOLDEXEDIR)
  95.  
  96.     ;
  97.     ; Delete the data extractor
  98.     ;
  99.     (delete
  100.         (tackon #TDESTDIR "TOBMakeDat")
  101.         (prompt "Deleting data extractor slave")
  102.         (optional fail force)
  103.     )
  104.  
  105.     ;
  106.     ; Did the data extractor work?
  107.     ; Check that the file was created
  108.     ;
  109.     (if (<>    (getsize (tackon #TDATDIR "main")) 96768)
  110.         (abort "Could not create data file !")
  111.     )
  112.  
  113.     (message "\n\nData file successfuly created!"
  114.              "\n\nMultitasking is re-enabled."
  115.     )
  116. ))
  117.  
  118. ;---------------------------------------------------------------------------
  119. ; Make save disk images
  120.  
  121. (procedure S_InstallSaves
  122. (
  123.     ;
  124.     ; Get number of save disks to create in total
  125.     ;
  126.     (set #TNUMSAVE
  127.         (asknumber
  128.             (prompt    "How many virtual save disks do you want to use in total?\n\n"
  129.                     "Each save disk requires approximately 900K of hard drive space."
  130.             )
  131.             (range 1 8)
  132.             (default 1)
  133.             (help @asknumber-help)
  134.         )
  135.     )
  136.  
  137.     ;
  138.     ; Create blank save disk images
  139.     ;
  140.     (set #TSAVENUM 1)
  141.     (until
  142.         (> #TSAVENUM #TNUMSAVE)
  143.         (
  144.             (set #TSAVENAM (tackon #TDATDIR (cat "Disk." (+ 1 #TSAVENUM))))
  145.             (working (cat "Creating blank save disk image\n" #TSAVENAM))
  146.             (set #TRCODE (run (cat "TOBMakeSave " #TSAVENAM)))
  147.             (if (>= #TRCODE 100)
  148.                 (abort
  149.                     (cat "Could not create blank save disk image !\n\nError: " #TRCODE)
  150.                 )
  151.             )
  152.             (set #TSAVENUM (+ #TSAVENUM 1))
  153.         )
  154.     )
  155.  
  156.     ;
  157.     ; Install save disks, overwriting blanks created above
  158.     ;
  159.     (set #TSAVEDONE 0)
  160.     (set #TSAVENUM 1)
  161.     (set #TSAVEPMT "any existing save disks")
  162.     (until
  163.         (= 1 #TSAVEDONE)
  164.         (if    (> #TSAVENUM #TNUMSAVE)
  165.             (set #TSAVEDONE 1)
  166.             (if    (= 0
  167.                     (askbool
  168.                         (prompt (cat "Do you want to install " #TSAVEPMT "?"))
  169.                         (help @askchoice-help)
  170.                     )
  171.                 )
  172.                 (set #TSAVEDONE 1)
  173.                 (
  174.                     (S_MakeDisk (+ 1 #TSAVENUM) (cat "save disk " #TSAVENUM))
  175.                     (set #TSAVENUM (+ #TSAVENUM 1))
  176.                     (set #TSAVEPMT "another existing save disk")
  177.                 )
  178.             )
  179.         )
  180.     )
  181. ))
  182.  
  183. ;---------------------------------------------------------------------------
  184.  
  185. (welcome "Welcome to the Tower of Babel HD Installer")
  186. (set @app-name (cat "Tower of Babel"))
  187. (set #TROOTDIR "RAM:")
  188. (set #TDESTDIR "")
  189. (set #TDATDIR "")
  190. (set #TSRCDRIVE 0)
  191.  
  192. (if    (<> @user-level 2)
  193.     (abort "You must select 'Expert' user level")
  194. )
  195.  
  196. (if    (< @installer-version 2818051)
  197.     (abort "This package requires at least version 43.3 of the Installer program")
  198. )
  199.  
  200. (message "\n\nWelcome to the Tower of Babel HD Installer\n"
  201.          "(c) 1997 John Girvin\n\n"
  202.          "Please read the documentation thoroughly before"
  203.          " attempting to use this installer!\n\n"
  204.          "This is version 1.00\n\n"
  205.          "Click 'Proceed' to begin."
  206. )
  207.  
  208. ;
  209. ; Get directory to install TOB in
  210. ;
  211. (set #TROOTDIR
  212.     (askdir
  213.         (prompt "Where would you like Tower of Babel installed?\n"
  214.                 "(a new drawer called 'Tower_of_Babel' will be created here)"
  215.         )
  216.         (help @askdir-help)
  217.         (default #TROOTDIR)
  218.     )
  219. )
  220. (set #TDESTDIR (tackon #TROOTDIR "Tower_of_Babel/"))
  221. (set #TDATDIR  (tackon #TDESTDIR "data/"))
  222.  
  223. ;
  224. ; Get drive to install from
  225. ;
  226. (set #TSRCDRIVE
  227.     (askchoice
  228.         (prompt "Which drive do you wish to install from?")
  229.         (help @askchoice-help)
  230.         (choices "DF0:" "DF1:" "DF2:" "DF3:")
  231.         (default #TSRCDRIVE)
  232.     )
  233. )
  234.  
  235. ;
  236. ; Create the installation directories
  237. ;
  238. (makedir #TDESTDIR
  239.     (prompt "The directory '" #TDESTDIR "' will now be created")
  240.     (help @makedir-help)
  241.     (infos)
  242.     (confirm)
  243. )
  244.  
  245. (makedir #TDATDIR
  246.     (prompt "The directory '" #TDATDIR "' will now be created")
  247.     (help @makedir-help)
  248. )
  249.  
  250. ;
  251. ; Copy WHDload
  252. ; Copy now because its required by the data extractor slave
  253. ;
  254. (copyfiles
  255.     (prompt "Copying WHDLoad program")
  256.     (help @copyfiles-help)
  257.     (source "WHDLoad")
  258.     (dest #TDESTDIR)
  259.     (nogauge)
  260.     (noposition)
  261.     (optional fail force)
  262. )
  263.  
  264. ;
  265. ; Install the game and save disks
  266. ;
  267. (S_InstallGame)
  268. (S_InstallSaves)
  269.  
  270. ;
  271. ; Copy disk drawer icon
  272. ;
  273. (copyfiles
  274.     (prompt "Copying HD drawer icon")
  275.     (help @copyfiles-help)
  276.     (source "Drawer.inf")
  277.     (newname "Tower_of_Babel.info")
  278.     (dest #TROOTDIR)
  279.     (nogauge)
  280.     (optional fail force)
  281. )
  282.  
  283. ;
  284. ; Copy slave program
  285. ;
  286. (copyfiles
  287.     (prompt "Copying HD loader slave")
  288.     (help @copyfiles-help)
  289.     (source "TOBHD")
  290.     (newname "Tower_of_Babel")
  291.     (dest #TDESTDIR)
  292.     (nogauge)
  293.     (optional fail force)
  294. )
  295.  
  296. ;
  297. ; Copy slave icon and set tooltypes
  298. ;
  299. (copyfiles
  300.     (prompt "Copying slave program icon")
  301.     (help @copyfiles-help)
  302.     (source "Slave.inf")
  303.     (newname "Tower_of_Babel.info")
  304.     (dest #TDESTDIR)
  305.     (nogauge)
  306.     (optional fail force)
  307. )
  308.  
  309. (tooltype
  310.     (prompt "Setting HD loader slave icon tooltypes")
  311.     (dest (tackon #TDESTDIR "Tower_of_Babel"))
  312.     (setdefaulttool "WHDLoad")
  313.     (settooltype "SLAVE" "Tower_of_Babel")
  314.     (settooltype "NOVBRMOVE" "")
  315.     (settooltype "PRELOAD" "")
  316. )
  317.